﻿using System;
using System.Collections;
using SharpSqlAnalyzer.nodes;

namespace SharpSqlAnalyzer
{
	// Token: 0x0200006C RID: 108
	public class TStatementList : TParseTreeNode, IEnumerable
	{
		// Token: 0x060002A5 RID: 677 RVA: 0x002F80EC File Offset: 0x002F62EC
		IEnumerator IEnumerable.GetEnumerator()
		{
			return this.items.GetEnumerator();
		}

		// Token: 0x17000039 RID: 57
		// (get) Token: 0x060002A6 RID: 678 RVA: 0x002F80F9 File Offset: 0x002F62F9
		public int Count
		{
			get
			{
				return this.size();
			}
		}

		// Token: 0x1700003A RID: 58
		public TCustomSqlStatement this[int pos]
		{
			get
			{
				if (pos < 0 || pos >= this.size())
				{
					throw new IndexOutOfRangeException();
				}
				return (TCustomSqlStatement)this.items[pos];
			}
		}

		// Token: 0x060002A8 RID: 680 RVA: 0x002F8127 File Offset: 0x002F6327
		public void Reset()
		{
			this.iteratorpos = -1;
		}

		// Token: 0x060002A9 RID: 681 RVA: 0x002F8130 File Offset: 0x002F6330
		public void Dispose()
		{
		}

		// Token: 0x1700003B RID: 59
		// (get) Token: 0x060002AA RID: 682 RVA: 0x002F8132 File Offset: 0x002F6332
		public TCustomSqlStatement Current
		{
			get
			{
				return this.curStatement;
			}
		}

		// Token: 0x060002AB RID: 683 RVA: 0x002F813C File Offset: 0x002F633C
		public bool MoveNext()
		{
			int num = this.iteratorpos + 1;
			this.iteratorpos = num;
			if (num >= this.items.Count)
			{
				return false;
			}
			this.curStatement = (TCustomSqlStatement)this.items[this.iteratorpos];
			return true;
		}

		// Token: 0x060002AC RID: 684 RVA: 0x002F8186 File Offset: 0x002F6386
		public virtual void resetiterator()
		{
			this.iteratorpos = -1;
		}

		// Token: 0x060002AD RID: 685 RVA: 0x002F818F File Offset: 0x002F638F
		public virtual bool hasNext()
		{
			bool flag = this.iteratorpos < this.items.Count - 1;
			if (flag)
			{
				this.iteratorpos++;
			}
			return flag;
		}

		// Token: 0x060002AE RID: 686 RVA: 0x002F81B7 File Offset: 0x002F63B7
		public virtual TCustomSqlStatement next()
		{
			return (TCustomSqlStatement)this.items[this.iteratorpos];
		}

		// Token: 0x060002AF RID: 687 RVA: 0x002F81CF File Offset: 0x002F63CF
		public virtual void remove()
		{
			throw new NotSupportedException();
		}

		// Token: 0x060002B0 RID: 688 RVA: 0x002F81D6 File Offset: 0x002F63D6
		public TStatementList()
		{
			this.items = new ArrayList();
			this.resetiterator();
			this.curStatement = null;
		}

		// Token: 0x060002B1 RID: 689 RVA: 0x002F81FD File Offset: 0x002F63FD
		public virtual int size()
		{
			return this.items.Count;
		}

		// Token: 0x060002B2 RID: 690 RVA: 0x002F820A File Offset: 0x002F640A
		public virtual void clear()
		{
			this.items.Clear();
		}

		// Token: 0x060002B3 RID: 691 RVA: 0x002F8217 File Offset: 0x002F6417
		public virtual void add(TCustomSqlStatement p)
		{
			this.items.Add(p);
		}

		// Token: 0x060002B4 RID: 692 RVA: 0x002F8226 File Offset: 0x002F6426
		public virtual TCustomSqlStatement get(int p)
		{
			return (TCustomSqlStatement)this.items[p];
		}

		// Token: 0x060002B5 RID: 693 RVA: 0x002F8239 File Offset: 0x002F6439
		public override void init(object arg1)
		{
			this.add((TCustomSqlStatement)arg1);
		}

		// Token: 0x060002B6 RID: 694 RVA: 0x002F8248 File Offset: 0x002F6448
		public override void doParse(TCustomSqlStatement psql, ESqlClause plocation)
		{
			for (int i = 0; i < this.size(); i++)
			{
				this.get(i).doParseStatement(psql);
			}
		}

		// Token: 0x060002B7 RID: 695 RVA: 0x002F8274 File Offset: 0x002F6474
		public override void accept(TParseTreeVisitor v)
		{
			v.preVisit(this);
			v.postVisit(this);
		}

		// Token: 0x060002B8 RID: 696 RVA: 0x002F8284 File Offset: 0x002F6484
		public override void acceptChildren(TParseTreeVisitor v)
		{
			v.preVisit(this);
			for (int i = 0; i < this.size(); i++)
			{
				this.get(i).acceptChildren(v);
			}
			v.postVisit(this);
		}

		// Token: 0x04001073 RID: 4211
		private TCustomSqlStatement curStatement;

		// Token: 0x04001074 RID: 4212
		internal int iteratorpos = -1;

		// Token: 0x04001075 RID: 4213
		internal ArrayList items;
	}
}
